import routes from './routers';
import { resolve } from 'path';
import config from './dev';
const { apiUrl, loginUrl } = config;
export default {
  // history: 'hash',
  routes,
  plugins: [
    [
      'umi-plugin-react',
      {
        antd: true,
        dva: true,
        dynamicImport: false,
        dll: true,
      },
    ],
    `${__dirname}/script.js`,
  ],
  hash: true,
  alias: {
    '@': resolve(__dirname, '../src'),
    '@u': resolve(__dirname, '../src/utils'),
    '@c': resolve(__dirname, '../src/components'),
    '@ajax': resolve(__dirname, '../src/utils/ajax.js'),
  },
  proxy: {
    '/api': {
      target: apiUrl,
      changeOrigin: true,
      pathRewrite: {
        '^/api': '',
      },
    },
    '/api/login': {
      target: loginUrl,
      changeOrigin: true,
      pathRewrite: {
        '^/api/login': '',
      },
    },
  },
  treeShaking: true,
};

